import request from "@/utils/request"

//定义公共的API
const BASE_URL = "system/itrItinerary";

export default {

   //分页查询
   getSightsOrderPageInfo(page, limit, searchObj) {
    return request({
        url: `${BASE_URL}/${page}/${limit}`,
        method: 'get',
        params: searchObj
    })
    },
    //删除
    // 根据id去删除一个用户
    removeId(id) {
        return request({
            url: `${BASE_URL}/removeItinerary/${id}`,
            method: 'delete'
        })
    },
    // 添加套餐
    saveItinerary(iTripItinerary) {
        return request({
            url: `${BASE_URL}/addItinerary`,
            method: 'post',
            data: iTripItinerary
        })
    },

    // 根据id去得到一个套餐 
    getItineraryById(id) {
        return request({
            url: `${BASE_URL}/findNodeById/${id}`,
            method: 'get'
        })
    },

    // 修改
    updateItinerary(iTripItinerary) {
        return request({
            url: `${BASE_URL}/updateITripItinerary`,
            method: 'post',
            data: iTripItinerary
        })
    },
    getArea(){
        return request({
            url: `${BASE_URL}/findArea`,
            method: 'post',
        //    data: id,
        })
    },
    getCity(areaId){
        return request({
            url: `${BASE_URL}/findCityByAreaId/${areaId}`,
            method: 'post',
           data:areaId
        })
    },
}